#ifndef VDCHATWGT_H
#define VDCHATWGT_H

#include <QTabWidget>

#include "VDSmile.h"
//namespace Ui {class VDChatWgt;};

class VDUser;
//class VDMesWebView;
class VDTalkWgt;

class VDChatWgt : public QTabWidget
{
	Q_OBJECT

	typedef QVector<VDTalkWgt*> VDTalks;

public:
	VDChatWgt(QWidget *parent = 0);
	~VDChatWgt();

protected:
	virtual void closeEvent(QCloseEvent *event);

private:
	VDTalkWgt* getTalkWgt(const VDUser&);
	void countDontReadAdd();
	void countDontReadRem();

private:
	VDTalkWgt *m_sharedTalkWgt;
	VDTalks m_talks;
	VDSmiles m_smiles;
	int m_countDontRead;

public slots:
	void openTalkWithUser(const VDUser &u);
	void openTalkChat();

	void makeTalkChat();
	void addMesUser(const QString &mes, const VDUser &u);
	void addChatUser(const QString &mes, const VDUser &u);

private slots:
	void slotChangeIcon(const QIcon&);
	void slotCurrentChanged(int index);
	void slotTabCloseRequested(int index);
	void slotTalkSendMesChat(const QString&);

signals:
	void dontReadAdd(const QString &mes, const VDUser& u);
	void dontReadRem(const VDUser& u);
	void sendMesUser(const QString&, const VDUser&);
	void sendMesChat(const QString&);
};

#endif // VDCHATWGT_H
